var t = getApp();

Page({
    data: {
        mainInfo: {},
        store_id: "",
        page_id: "",
        clientWidth: "375",
        page_name: "",
        btnFlag: !1,
        store_components: [],
        store_pageInfo: {},
        bottom_info: {},
        foot_type: "",
        current_page: 1,
        total_page: 0,
        decorate_isLoadMore: !0,
        lastIndex: "",
        bottomShowBol: !1,
        bottomShowBolIndex: 0
    },
    onLoad: function(t) {
        this.setData({
            store_id: t.store_id
        }), this.getStoreInfo();
    },
    onReady: function() {
        this.setData({
            clientWidth: wx.getSystemInfoSync().windowWidth
        });
    },
    onShow: function() {},
    getStoreInfo: function() {
        var o = this, e = this, a = t.getNetAddresss("plugin.store-cashier.frontend.store.get-store-info.get-the-provider");
        t._getNetWork({
            url: a,
            data: {
                store_id: this.data.store_id
            },
            success: function(t) {
                var a = t.data;
                e.setData({
                    isShow: !0
                }), 1 == a.result ? a.data.store_decorate && a.data.store_decorate.datas && (e.setData({
                    mainInfo: a.data.store_info,
                    page_id: a.data.store_decorate.id,
                    store_components: a.data.store_decorate.datas,
                    store_pageInfo: a.data.store_decorate.page_info,
                    foot_type: a.data.store_decorate.foot_type,
                    bottomShowBolIndex: a.data.store_decorate.page.count - 1
                }), -1 == a.data.store_decorate.foot_type ? o.setData({
                    bottom_info: {}
                }) : 1 == a.data.store_decorate.foot_type ? a.data.store_decorate.foot_id && a.data.store_decorate.foot_id.page_info ? o.setData({
                    bottom_info: JSON.parse(a.data.store_decorate.foot_id.page_info)
                }) : o.setData({
                    bottom_info: {}
                }) : 2 == a.data.store_decorate.foot_type && (!a.data.store_decorate.foot_id || a.data.store_decorate.foot_id instanceof Array ? o.setData({
                    bottom_info: {}
                }) : o.setData({
                    bottom_info: JSON.parse(a.data.store_decorate.foot_id.page_info)
                })), wx.setNavigationBarTitle({
                    title: o.data.store_pageInfo.page_title || "商家"
                }), wx.setNavigationBarColor({
                    backgroundColor: o.data.store_pageInfo.preview_color,
                    frontColor: 1 == o.data.store_pageInfo.font_color ? "#ffffff" : "#000000",
                    animation: {
                        duration: 400,
                        timingFunc: "easeIn"
                    }
                })) : wx.showToast({
                    title: a.msg,
                    icon: "none",
                    duration: 1500
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    turnTo: function() {
        var t = this.data.advertising;
        if (2 == t.is_minapp) if (t.minapp_sid) if (t.minapp_link2) try {
            wx.navigateToMiniProgram({
                appId: t.minapp_sid,
                path: t.minapp_link2,
                extraData: {},
                envVersion: "release",
                success: function(t) {},
                fail: function(t) {
                    wx.showToast({
                        title: "小程序跳转失败",
                        icon: "none",
                        duration: 2e3
                    });
                }
            });
        } catch (t) {
            wx.showToast({
                title: "小程序跳转失败",
                icon: "none",
                duration: 2e3
            });
        } else wx.showToast({
            title: "请设置跳转小程序后的跳转链接",
            icon: "none",
            duration: 2e3
        }); else wx.showToast({
            title: "请设置小程序所需跳转appId",
            icon: "none",
            duration: 2e3
        }); else {
            var o = t.minapp_link;
            try {
                wx.navigateTo({
                    url: o
                });
            } catch (t) {
                wx.showToast({
                    title: "链接设置错误",
                    icon: "none",
                    duration: 2e3
                });
            }
        }
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onPageScroll: function(t) {
        t.scrollTop > 80 ? this.data.btnFlag || this.setData({
            btnFlag: !0
        }) : this.data.btnFlag && this.setData({
            btnFlag: !1
        }), this.data.bottomShowBol && this.setData({
            bottomShowBol: !1
        });
    },
    onReachBottom: function() {
        this.setData({
            bottomShowBol: !0
        }), this.data.decorate_isLoadMore;
    },
    onShareAppMessage: function() {
        return {
            title: this.data.store_pageInfo.page_title ? this.data.store_pageInfo.page_title : "商家",
            path: "/packageG/o2o/HomeSeller/HomeSeller?store_id=".concat(this.data.store_id)
        };
    },
    onShareTimeline: function() {
        return {
            title: this.data.store_pageInfo.page_title ? this.data.store_pageInfo.page_title : "商家",
            path: "/packageG/o2o/HomeSeller/HomeSeller?store_id=".concat(this.data.store_id)
        };
    }
});